package com.buoy.base.aluminumpricespider.exception;

import lombok.Getter;

/**
 * 业务异常基类
 */
@Getter
public class BusinessException extends RuntimeException {
    
    private final String errorCode;
    private final int status;
    
    public BusinessException(String message) {
        this(message, "BUSINESS_ERROR", 400);
    }
    
    public BusinessException(String message, String errorCode) {
        this(message, errorCode, 400);
    }
    
    public BusinessException(String message, String errorCode, int status) {
        super(message);
        this.errorCode = errorCode;
        this.status = status;
    }
    
    public BusinessException(String message, Throwable cause) {
        this(message, "BUSINESS_ERROR", 400, cause);
    }
    
    public BusinessException(String message, String errorCode, int status, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.status = status;
    }
} 